-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test to close #3666, problems with typechecking GADTs #4069
Conversation
Log has a bunch of failures on
|
The issue can be reduced to something like: sealed trait Exp[T]
case class Var[T](name: String) extends Exp[T]
object Test {
def env[T](x: Var[T]): T = ???
def eval[S](e: Exp[S]) = e match {
case v: Var[foo] =>
env(v)
}
} This crashes when run through ==> isSubType Any <:< foo
==> isSubType Any <:< S
==> isSubType Any <:< foo The problem becomes apparent when we turn on the narrow gadt bound of type foo: from below to S TypeRef(NoPrefix,type S) false
narrow gadt bound of type S: from below to foo TypeRef(NoPrefix,type foo) false We end up with GADT constraints |
Good analysis, @smarter! |
Maybe this example with polymorphic recursion is also related: object Test {
class Foo[A]
case class Bar[A, B](f: B => Foo[A]) extends Foo[A]
def meth[A](consumer: A => Unit, s: Foo[A]): Unit = {
s match {
case bar: Bar[a, bt] => {
meth[bt](((e: bt) => meth(consumer, new Foo[a])), new Foo[bt])
}
}
}
} Again detected with assertion failure for Any <:< a, frozen = true
assertion failure for Any <:< A, frozen = true
assertion failure for Any <:< a, frozen = true
... @smarter WDYT? What would be a workaround in my case (without disabling |
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
This includes a forward-port of the upstream changes in * scala-js/scala-js@887d957 Require an explicit name in @jsglobal for 'apply' and setter names. * scala-js/scala-js@354cfdf Allow @jsglobal without explicit names inside Scala objects. * scala-js/scala-js@9fa6a83 Fix scala#4069: Make @jsimport's second arg default to the annotatee's name.
Currently fails some checks in local testing and on CI, to investigate.